<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
    <head>
        <th:block th:include="include :: header('主页')"/>
    </head>

    <body class="gray-bg">
        <div class="wrapper wrapper-content">

            <div class="row">
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>姓名</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins" th:text="${user.userName}"></h1>
                        </div>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>角色</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins" th:text="${user.roles[0].roleName}"></h1>
                        </div>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>部门</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins" th:text="${user.dept.deptName}"></h1>
                        </div>
                    </div>
                </div>
                <div class="col-sm-3" th:if="${leaveCheckCount != 0}">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>待审批</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins" th:text="${leaveCheckCount}"></h1>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>通知公告</h5>
                        </div>
                        <div class="ibox-content table-striped">
                            <table id="bootstrap-table"></table>
                        </div>
                    </div>
                </div>
                <!--<div class="col-sm-4">
                    <div class="ibox-title">
                        <h5>今日代办清单</h5>
                    </div>
                    <div class="ibox-content">
                        <ul class="list-group">
                            <li class="list-group-item">免费域名注册</li>
                            <li class="list-group-item">免费 Window 空间托管</li>
                            <li class="list-group-item">图像的数量</li>
                            <li class="list-group-item">
                                <span class="badge">新</span>
                                24*7 支持
                            </li>
                            <li class="list-group-item">每年更新成本</li>
                            <li class="list-group-item">
                                <span class="badge">新</span>
                                折扣优惠
                            </li>
                        </ul>
                    </div>
                </div>-->
            </div>

            <th:block th:include="include :: footer"/>
            <script th:inline="javascript">
                var prefix = ctx + "system/notice";
                var noticeTypeDatas = [[${@dict.getType('sys_notice_type')}]];


                $(function () {
                    var options = {
                        url: prefix + "/list",
                        detailUrl: prefix + "/noticeDetail/{id}",
                        modalName: "通知公告",
                        clickToSelect: false,
                        showSearch: false,
                        showRefresh: false,
                        showColumns: false,
                        showToggle: false,
                        showExport: false,
                        columns: [{
                            checkbox: false,
                        },
                            {
                                field: 'noticeTitle',
                                title: '公告标题'
                            },
                            {
                                field: 'noticeType',
                                title: '公告类型',
                                formatter: function (value, row, index) {
                                    return $.table.selectDictLabel(noticeTypeDatas, value);
                                }
                            },
                            {
                                field: 'createBy',
                                title: '创建者'
                            },
                            {
                                field: 'createTime',
                                title: '创建时间',
                            },
                            {
                                title: '操作',
                                align: 'center',
                                formatter: function(value, row, index) {
                                    var actions = [];
                                    actions.push('<a class="btn btn-primary" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.noticeId + '\',\'false\')"><i class="fa fa-remove"></i>查看</a>');
                                    return actions.join('');
                                }
                            }]
                    };
                    $.table.init(options);
                });
            </script>
    </body>
</html>
